clear all
discard
adopath + "$healthdo\Health adofiles"

set more off
pause off

set maxvar 10000


****************************
*--------------------------*
*- CLEAN HEALTH VARIABLES -*
*--------------------------*
****************************

*  1. merge datasets 
	run "$healthdo\1 merge_with_W7.do" 

*  2. clean data 
	run "$healthdo\2 cleaning_with_W7.do" 

*  3. derive health variables 
	run "$healthdo\3 ever diagnosed raw_with_W7.do" 

*  4. construct variables for medication and age diagnosis 
	run "$healthdo\4 medication_with_W7.do" 

*  5. construct problem indicators 
	run "$healthdo\5 problem indicators_with_W7.do"

*  6. sort out missing observations 
	run "$healthdo\6 naive health vars_with_W7.do" 

*  7. feed-forward errors
	run "$healthdo\7 ff problems_with_W7.do" 

*  8. disputes 
	run "$healthdo\8 disputes_with_W7.do"

*  9. re-coding dates 
	run "$healthdo\9 recoding dates_with_W7.do" 

* 10. Sorting out remaining inconsistencies and missing observations 
	run "$healthdo\10 inconsistencies and missing observations_with_W7.do"
	
* 11. Deriving onsets 
	run "$healthdo\11 onsets_with_W7.do" 
	
* 12. keep variables of interest 
	run "$healthdo\12 keep_with_W7.do" 
	
